package com.itheima.个人代码.IO流2;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/*字符缓冲流*/
public class Demo9 {
    public static void main(String[] args) throws IOException {
        //bufferedreaderdemo1();
        BufferedReader br=new BufferedReader(new FileReader("IO流2和对象操作流properties\\stu.txt"));
        int len;
        while((len=br.read())!=-1){
            System.out.print((char)len);
        }

    }

    public static void bufferedreaderdemo1() throws IOException {
        BufferedReader br=new BufferedReader(new FileReader("IO流2和对象操作流properties\\stu.txt"));
        char[] chars=new char[1024];
        int len;
        while((len=br.read(chars))!=-1){
            System.out.println(new String(chars,0,len));
        }
    }
}
